package com.will.weiyuekotlin.net

import android.support.annotation.StringDef
import com.will.weiyuekotlin.bean.FreshNewsArticleBean
import com.will.weiyuekotlin.bean.FreshNewsBean
import com.will.weiyuekotlin.bean.JdDetailBean
import com.will.weiyuekotlin.bean.WeatherBean
import io.reactivex.Observable
import java.lang.annotation.Retention
import java.lang.annotation.RetentionPolicy

/**
 */
 class WeatherApi(private val mService: WeatherApiService) {

    companion object {

        private var sInstance: WeatherApi? = null

        fun getInstance(weatherApiService: WeatherApiService): WeatherApi {
            if (sInstance == null)
                sInstance = WeatherApi(weatherApiService)
            return sInstance as WeatherApi
        }
    }


    /**
     * 获取天气信息
     *
     * @return
     */
    fun getWeather(province: String,city :String,county :String): Observable<WeatherBean> {
        return mService.getWeather(province, city,county)
    }

}
